#include "studentinedx.h"
#include "ui_studentinedx.h"
#include <QSqlQuery>
#include "global.h"
#include "s_sendexange2.h"
#include "s_sendneed.h"
#include "s_needshow.h"
#include "s_exchangeshow.h"
QString global3;

studentInedx::studentInedx(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::studentInedx)
{
    ui->setupUi(this);

    //设定欢迎名字
//    qDebug()<<"userid = "<<global::userid;
    QString sql=QString("select sname from student where sid='%1'").arg(global::userid);
    QSqlQuery query;
    query.exec(sql);
//    qDebug()<<sql;
    QString qname;
    while(query.next())
        qname=QString("欢迎你，%1").arg(query.value(0).toString());
//    qDebug()<<(query.value(0));
    ui->helloText->setText(qname);

    global3=global::userid;
}

studentInedx::~studentInedx()
{
    delete ui;
}



void studentInedx::on_sendNeedBtn_clicked()
{
    s_sendNeed window;
    window.exec();
}


void studentInedx::on_exchangeManage_clicked()
{
    s_sendExange2 window;
    window.exec();
}


void studentInedx::on_needShow_clicked()
{
    s_needShow window;
    window.exec();
}


void studentInedx::on_exchangeShow_clicked()
{
    s_exchangeShow window;
    window.exec();
}

